package interfaces;

import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class afterPlayScreen extends MyPanel implements ActionListener
{
	private MyButton playButton;
	//private MyButton summaryButton;
	private MyButton toMenuButton;
	private MainWindow mainWin;
	public afterPlayScreen(MainWindow win)
	{
		super();
		mainWin=win;
		int w=win.getWidth();
		int h=win.getHeight();
		int button_w=w/3;
		int button_h=h/9;
		int space_x=w/3;
		int space_y=0;
		int padd_y=h/3;
		this.setLayout(null);
		playButton=new MyButton("Play again");
		//playButton.setBackground(Color.white);
		playButton.setBounds(space_x,padd_y,button_w,button_h);
		this.add(playButton);
//		summaryButton=new MyButton("Summary");
//		//summaryButton.setBackground(Color.white);
//		summaryButton.setBounds(space_x,+button_h+padd_y+space_y,button_w,button_h);
//		this.add(summaryButton);
		toMenuButton=new MyButton("Quit game");
		//toMenuButton.setBackground(Color.white);
		toMenuButton.setBounds(space_x,button_h+2*space_y+padd_y,button_w,button_h);
		this.add(toMenuButton);  
		this.paintBackGround("images/screen3.jpg", w,h);
		
		playButton.addActionListener(this);
		toMenuButton.addActionListener(this);
	//	summaryButton.addActionListener(this);
	}
	@Override
	public void actionPerformed(ActionEvent arg0) 
	{
		// TODO Auto-generated method stub
		if(arg0.getSource()==playButton)
		 mainWin.changeScreen(new PlayScreen(mainWin));
		if(arg0.getSource()==toMenuButton)
		 mainWin.changeScreen(new mainMenuScreen(mainWin));	
	//	if(arg0.getSource()==summaryButton)
		// mainWin.changeScreen(new SummaryScreen(mainWin)); 	
	}
}
